import os
import shutil

gen = os.walk(".\\DataAnalysis")

while True:

    try:

        info = next(gen)

    except StopIteration:

        print("__pycache__文件清理完成")

        break
              
    else:
              
        if "__pycache__" in info[1]:

            path = os.path.join(info[0],'__pycache__')

            shutil.rmtree(path)

        
